//var _rs = new Ext.data.Record({
//	id:"",
//	name:"",
//	money:0
//});
//
//sm:new Ext.grid.RowSelectMode({
//	
//});

Ext.onReady(function(){
	removeButtonClick = function(){
		var _sm = this.getSelectionModel();
		try{
			if(_sm.getCount() == 0){
				throw Error("你还没选择一行");
			}
			Ext.Msg.conform("系统询问","你是否确认删除此行?",this.onRemoveQuestion,this);
			_sm.getSelected();
		}catch(_err){
			Ext.msg.alert("系统提示",_err.description);
		}
	}

	onRemoveQuestion= function(_btn){
		if(_tn=="yes"){
			this.getSrore().remove(this.getSelectionMode().getSelected());
		}
	}
	
	var loginForm = new Ext.FormPanel({
        labelWidth: 50, // label settings here cascade unless overridden
        url:'${pageContext.request.contextPath}/userAction!test.action',
        frame:true,
        renderTo:Ext.getBody(),
        //title: 'none',
        bodyStyle:'padding:5px 5px 0',
        width: 350,
        defaults: {width: 230},
        defaultType: 'textfield',

        items: [{
                fieldLabel: '账号',
                name: 'name',
                allowBlank:false,
                emptyText:"天下账号",
                blackText:"姓名不能为空"
            },{
                fieldLabel: '密码',
                name: 'pwd'
            }
        ],

        buttons: [{
            text:'注册',
            disabled:false,
            handler:function(){  
            	win.hide();
            	registWin.show();
            }  
        },
        {
            text:'登录',
            disabled:false,
            handler:function(){  
            	loginForm.getForm().submit({  
                    success:function(form,action){  
                        Ext.Msg.alert('消息',action.result.msg); 
                        wind.hide();
                    },  
                    failure:function(){  
                        Ext.Msg.alert('消息','失败');  
                    }  
                });  
            }  
        },{
            text: '取消',
            handler: function(){
                win.hide();
            }
        }]
    });
});
